﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="mfOrderList.aspx.cs" Inherits="msBsc.WebUi.mMall.Buyer.mfOrderList" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>手机地接客商城</title>
    <%=getMeta()%>
    <link rel="stylesheet" type="text/css" href="/themes/mStyle1/mGlobal.css" charset="gbk" />
    <link rel="stylesheet" type="text/css" href="/themes/mStyle1/css/home/base.css" charset="gbk" />
    <link href="/jqPlugin/laydate/skins/default/laydate.css" rel="stylesheet" charset="gbk" />
    <link href="/themes/mStyle1/css/public/mOrder.css" rel="stylesheet" />
    <%=getBodyBeforeJs()%>

    <script type="text/javascript" src="/jqPlugin/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="/jqPlugin/js/jBase.js"></script>
    <script type="text/javascript" src="/jqPlugin/js/jmPage.js"></script>
    <script type="text/javascript" src="/themes/Style1/jsQt.js"></script>
    <script type="text/javascript" src="/jqPlugin/js/laytpl.js"></script>
    <script type="text/javascript" src="/themes/wStyle1/js/comm/VerifyJs.js"></script>
    <script type="themes/wStyle1/js/comm/DateInfo.js"></script>
    <script type="text/javascript">
        $(window).load(function () {
        });
        //        $(window).bind('resize', function () { _self._ResizeHandler(_self); })
        //        .bind('scroll', function () { _self._ResizeHandler(_self); });
    </script>
    <!--head fix rgn-->
    <style type="text/css">
        .c_order {
            margin-top: 0px;
        }

        .menu_order {
            display: table;
            width: 100%;
            color: #999;
            text-align: center;
            line-height: 36px;
        }

            .menu_order .menu_order_cell {
                display: table-cell;
            }

                .menu_order .menu_order_cell a {
                    font-family: 微软雅黑;
                    cursor: pointer;
                    font-size: 18px;
                }

                .menu_order .menu_order_cell .checkMenu {
                    color: #666;
                }

        .pager {
            display: block;
            height: 50px;
            margin-bottom: 20px;
        }

            .pager a {
                background-color: #fff;
                border: 1px solid #bfc2c3;
                color: #3c3c3c;
                display: block;
                height: 50px;
                line-height: 50px;
                outline: medium none;
                position: absolute;
                text-align: center;
                text-decoration: none;
                width: 100%;
            }
    </style>
    <base target="_self" />
</head>
<body>
    <div class="viewport">
        <%=msBsc.WebUi.Code.QtHtmlGet.GetWapHeaderMenuHtml(true) %>
        <form action='#' method="post" id="J_EmailForm">
            <input type="hidden" id="orderStatus" value="0" />
            <input type="hidden" id="pageIndex" value="" />
            <div class="c_order">
                <div class="menu_order">
                    <div class="menu_order_cell"><a data-value="0" class="menu_order_info checkMenu">全部</a></div>
                    <div class="menu_order_cell"><a data-value="1" class="menu_order_info">待确认</a></div>
                    <div class="menu_order_cell"><a data-value="2" class="menu_order_info">待付款</a></div>
                    <div class="menu_order_cell"><a data-value="4" class="menu_order_info">已完成</a></div>
                </div>
                <div id="order_list">
                    <%--  <div class="order_info_list">
                        <div class="order_comm">
                            <div class="fl_order_comm order_list_number"><span>订单号：</span><span id="orderNumber">4455645aaaaaaaaa</span></div>
                            <div class="fr_order_comm order_list_number order_stime">
                                <div>
                                    <span>下单时间：</span>
                                    <span>2010-10-12</span>
                                </div>
                            </div>
                        </div>
                        <div class="order_comm">
                            <div class="l_order_user">
                                <a id="djack_c_img" class="l_order_user_href">
                                    <img id="djack_img" src="/UpLoad/Djack/djack.jpg" /></a>
                            </div>
                            <div class="r_order_user">
                                <a id="djack_name" class="r_order_user_href">中国旅游网中国旅游网中国旅游网中国旅游网中国旅游网</a>
                            </div>
                            <div class="div_order_status">
                                <div class="order_money">￥100000.00</div>
                                <div class="order_status">待确认</div>
                            </div>
                        </div>
                        <div class="order_operating">
                            <div class="operatInfo"><a>查看详情</a></div>
                            <div class="operatInfo"><a>查看退款</a></div>
                        </div>
                    </div>--%>
                </div>
                <div>
                    <div class="pager" style="display: none">
                        <a href="###" id="pageNextText">查询更多</a>
                    </div>
                </div>
            </div>


            <xmp id="svc_list_temp_order" style="display: none">
             {{#for(var i=0,len=d.rows.length;i < len;i++){ }}
             <div class="order_info_list">
                        <div class="order_comm">
                            <div class="fl_order_comm order_list_number"><span>订单号：</span><span>{{d.rows[i].ORDER_CODE}}</span></div>
                            <div class="fr_order_comm order_list_number order_stime">
                                <div>
                                    <span>下单时间：</span>
                                    <span>{{formatDate1(new Date(d.rows[i].ORDER_TIME))}}</span>
                                </div>
                            </div>
                        </div>
                        <div class="order_comm">
                            <div class="l_order_user">
                                <a class="l_order_user_href">
                                    <img src="{{d.rows[i].SOLDER_PIC}} 65x65img.jpg" /></a>
                            </div>
                            <div class="r_order_user">
                                <a class="r_order_user_href">{{d.rows[i].SOLDER_NICK}}</a>
                            </div>
                            <div class="div_order_status">
                                <div class="order_money">￥{{getNumber(d.rows[i].PAYABLE_AMT)}}</div>
                                <div class="order_status">
                                    {{#if(d.rows[i].ORDER_STATUS==1){ }}
                                        {{#if(CompareDate(new Date(), new Date(d.rows[i].ORDER_START_TIME)) == false){ }}
                                            已过期
                                        {{#} }}
                                        {{#if(CompareDate(new Date(), new Date(d.rows[i].ORDER_START_TIME)) == true){ }}
                                            待确认
                                        {{#} }}
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==2){ }}
                                        {{#if(CompareDate(new Date(), new Date(d.rows[i].ORDER_START_TIME)) == false){ }}
                                            已过期
                                        {{#} }}
                                        {{#if(CompareDate(new Date(), new Date(d.rows[i].ORDER_START_TIME)) == true){ }}
                                            待付款
                                        {{#} }}
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==3){ }}
                                    已付款
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==4){ }}
                                    已完成
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==5){ }}
                                    流程已关闭
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==6){ }}
                                    正在退款
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==7||d.rows[i].ORDER_STATUS==13){ }}
                                    已退款
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==8){ }}
                                    已取消
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==9){ }}
                                    已删除
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==10){ }}
                                    已取消退款
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==11){ }}
                                    拒绝退款
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==12){ }}
                                    已拒绝订单
                                    {{#} }}
                                </div>
                            </div>
                        </div>
                        <div class="order_operating">
                            {{#if(d.rows[i].ORDER_STATUS==1){ }}
                                    <div class="operatInfo"><a href="/mb_OrderInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}">查看详情</a></div>
                                    {{#if(CompareDate(new Date(), new Date(d.rows[i].ORDER_START_TIME)) == false){ }}
                                    <div class="operatInfo"><a onclick="deleteOrder('{{d.rows[i].ORDERS_INFO_ID}}')">删除订单</a></div>
                                {{#} }}
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==2){ }}
                                    <div class="operatInfo"><a href="/mb_OrderInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}">查看详情</a></div>
                                    {{#if(CompareDate(new Date(), new Date(d.rows[i].ORDER_START_TIME)) == false){ }}
                                    <div class="operatInfo"><a onclick="deleteOrder('{{d.rows[i].ORDERS_INFO_ID}}')">删除订单</a></div>
                                {{#} }}
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==3){ }}
                                    <div class="operatInfo"><a href="/mb_OrderInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}">查看详情</a></div>
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==4){ }}
                                    <div class="operatInfo"><a href="/mb_OrderInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}">查看详情</a></div>
                                    <div class="operatInfo"><a onclick="deleteOrder('{{d.rows[i].ORDERS_INFO_ID}}')">删除订单</a></div>
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==5){ }}
                                    <div class="operatInfo"><a href="/mb_OrderInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}">查看详情</a></div>
                                    <div class="operatInfo"><a onclick="deleteOrder('{{d.rows[i].ORDERS_INFO_ID}}')">删除订单</a></div>
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==6){ }}
                                    <div class="operatInfo"><a href="/mb_OrderInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}">查看详情</a></div>
                            <div class="operatInfo"><a href="mb_RefundInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}&orderStatus={{d.rows[i].ORDER_STATUS}}">查看退款</a></div>
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==7||d.rows[i].ORDER_STATUS==13){ }}
                                    <div class="operatInfo"><a href="/mb_OrderInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}">查看详情</a></div>
                            <div class="operatInfo"><a href="mb_RefundInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}&orderStatus={{d.rows[i].ORDER_STATUS}}">查看退款</a></div>
                                    <div class="operatInfo"><a onclick="deleteOrder('{{d.rows[i].ORDERS_INFO_ID}}')">删除订单</a></div>
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==8){ }}
                                    <div class="operatInfo"><a href="/mb_OrderInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}">查看详情</a></div>
                                    <div class="operatInfo"><a onclick="deleteOrder('{{d.rows[i].ORDERS_INFO_ID}}')">删除订单</a></div>
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==9){ }}
                                    <div class="operatInfo"><a href="/mb_OrderInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}">查看详情</a></div>
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==10){ }}
                                    <div class="operatInfo"><a href="/mb_OrderInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}">查看详情</a></div>
                            <div class="operatInfo"><a href="mb_RefundInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}&orderStatus={{d.rows[i].ORDER_STATUS}}">查看退款</a></div>
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==11){ }}
                                    <div class="operatInfo"><a href="/mb_OrderInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}">查看详情</a></div>
                            <div class="operatInfo"><a href="mb_RefundInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}&orderStatus={{d.rows[i].ORDER_STATUS}}">查看退款</a></div>
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==12){ }}
                                    <div class="operatInfo"><a href="/mb_OrderInfo.htm?orderId={{d.rows[i].ORDERS_INFO_ID}}">查看详情</a></div>
                                    <div class="operatInfo"><a onclick="deleteOrder('{{d.rows[i].ORDERS_INFO_ID}}')">删除订单</a></div>
                                    {{#} }}
                            
                        </div>
                    </div>
                <div class="excision"></div>
                                
            {{#} }}
                           </xmp>

        </form>
        <script type="text/javascript" src="/jqPlugin/laydate/laydate.js" charset="gbk"></script>
        <script src="/themes/wStyle1/js/comm/DateInfo.js"></script>
        <script type="text/javascript">

            (function () {
                $("#h_title").text("买入商品");
                $("#orderStatus").val(0);
                $("#pageIndex").val(1);
                $(".menu_order_info").click(function () {
                    if (!$(this).hasClass("checkMenu")) {
                        $(".menu_order_info").removeClass("checkMenu");
                        $(this).addClass("checkMenu");
                        $("#orderStatus").val($(this).attr("data-value"));
                        $('#order_list').html("");
                        btnDo(1);
                    }
                });
                //点击更多
                $("#pageNextText").live("click", function () {
                    nextPage();
                });
                $.getMessageCount();
            })()

            function btnDo(pIndex) {
                var opart = new jsonRow();
                opart.AddCell("ACTION", "getOrderList");
                opart.AddCell("pageRows", 10);
                opart.AddCell("orderStatus", $("#orderStatus").val());
                opart.AddCell("pageNum", pIndex);
                ajaxComm(opart);
            }
            btnDo(1);
            function setOrderList(data) {
                if (IsNull(data) || IsNull(data.rows)) {
                    return;
                }
                var _html = $("#svc_list_temp_order").html();

                laytpl(_html).render(data, function (render) {
                    $('#order_list').append(render);
                });
                showNextPage(data.rows[0].DATACOUNT);
            }

            //是否显示更多
            function showNextPage(dataCount) {
                var pIndex = $("#pageIndex").val();
                if (IsNull(pIndex)) {
                    pIndex = 1;
                }
                var pageIndex = parseInt(pIndex);
                var count = parseInt(dataCount);
                if (pageIndex * 10 < count) {
                    $(".pager").show();
                } else {
                    $(".pager").hide();
                }
            }

            //更多
            function nextPage() {
                var pIndex = $("#pageIndex").val();
                if (IsNull(pIndex) || isNaN(pIndex)) {
                    pIndex = 1;
                }
                var pageIndex = parseInt(pIndex) + 1;
                $("#pageIndex").val(pageIndex);
                btnDo(pageIndex);
            }
            /*
              * 删除订单
            */
            function deleteOrder(orderId) {
                if (IsNull(orderId)) {
                    alert("请选择要删除的订单");
                    return;
                }
                if (confirm("删除的订单是不可恢复的，您确定要删除吗?") == false) {
                    return;
                }
                var opart = new jsonRow();
                opart.AddCell("orderId", orderId);
                opart.AddCell("ACTION", "deleteOrder");
                ajaxComm(opart);
            }
        </script>
    </div>
</body>
<%=getBodyAfterJs() %>
</html>
